<template>
	<view class="list-item pre-hover" hover-class="hover">
		<image :src="getItem.img" mode="aspectFill" class="product-img"></image>
		<QS-P width="30rpx"></QS-P>
		<view class="flex_column_between_none flex_1 width_0">
			<text class="product-name text-overflow_ellipsis">{{getItem.name}}</text>
			<view class="flex_row_none_c">
				<view class="progress-box">
					<progress activeColor="#F52F50" :percent="getItem.percent" active active-mode="forwards" />
				</view>
				<QS-P width="30rpx"></QS-P>
				<text class="sell">已售{{getItem.sum}}件</text>
			</view>
			<view class="product-bot-box">
				<view class="flex_row_none_c">
					<view class="flex_row_none_e">
						<text class="price-pre price-weight display_block">￥</text>
						<text class="price price-weight display_block">{{getItem.price}}</text>
					</view>
					<text class="through-price">￥{{getItem.throughPrice}}</text>
				</view>
				<slot name="bot-right"></slot>
			</view>
		</view>
	</view>
</template>

<script>
	import QSSuperComponentCustomCompMixin from '../QSSuperComponentCustomCompMixin.js'
	export default {
		mixins: [QSSuperComponentCustomCompMixin({componentType:'bargainBuy-1'})],
		props: {
			backgroundColor: {
				type: String,
				default: ''
			},
			item: {
				type: Object,
				default: ()=>({})
			}
		},
		computed: {
			getItem() {
				const o = this.item || {};
				return {name: '', img: '', percent: 0, sum: 0, price: 0, throughPrice: 0, ...o};
			}
		}
	}
</script>

<style scoped>
	.list-item{
		display: flex;
		flex-direction: row;
		padding: 25rpx;
	}
	
	.product-img{
		width: 220rpx;
		height: 220rpx;
		background-color: #F2F2F2;
		border-radius: 8rpx;
	}
	.product-name{
		font-size: 32rpx;
	}
	
	.product-bot-box{
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
	}
	
	.price-pre{
		font-size: 22rpx;
		color: #F52F50;
	}
	.price{
		font-size: 32rpx;
		color: #F52F50;
	}
	.through-price {
		margin-left: 15rpx;
		font-size: 22rpx;
		color: #BBBBBB;
		text-decoration: line-through;
	}
	
	.sell{
		font-size: 24rpx;
		color: #666666;
	}
	
	.progress-box{
		flex: 1;
		width: 0;
		border-radius: 30px;
		overflow: hidden;
	}
</style>
